home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / COOLVIEW.ZIP / VIEW50_1.ASM < prev    next >
Assembly Source File  |  1995-03-05  |  2KB  |  73 lines

  1. ; View 50-lines screen in Text Mode
  2. ; Coded '95 by Paradise, 1995.III.3
  3. ; Lublin, Poland
  4. ; paradise@bachus.umcs.lublin.pl
  5. ;
  6. ; Example : Load bin screen from file
  7. ;
  8. ; Need : external file called 'FName' as 8000bytes bin file
  9. ;
  10. ; Compile : tasm view50_1.asm
  11. ;           tlink /t view50_1.obj
  12. ;
  13.  
  14. Code  SEGMENT PARA PUBLIC 'CODE'
  15.       ASSUME CS:Code, DS:Code
  16.       Org 100h
  17.  
  18. Body  PROC FAR
  19.       ; set 400 scan lines
  20.       mov ax, 1202h
  21.       mov bl, 30h
  22.       int 10h
  23.       ; set text mode
  24.       mov ax, 3h
  25.       int 10h
  26.       ; load 8x8 font
  27.       mov ax, 1112h
  28.       mov bl, 0
  29.       int 10h
  30.       ; open file - only for reading
  31.       mov dx, offset FName
  32.       mov ax, 3d02h
  33.       int 21h
  34.       jnc noerror
  35.       ; if error then show message, close file end exit
  36.       mov dx, offset FErr
  37.       mov ah, 9
  38.       int 21h
  39.       jmp fclose
  40. noerror:
  41.       mov bx, ax
  42.       ; seek to start of file
  43.       xor cx, cx
  44.       xor dx, dx
  45.       mov ax, 4200h
  46.       int 21h
  47.       ; load screen from file
  48.       mov dx, 0b800h
  49.       mov ds, dx
  50.       xor dx, dx
  51.       mov cx, 8000
  52.       mov ax, 3f00h
  53.       int 21h
  54. fclose:
  55.       ; close file
  56.       mov ah, 3eh
  57.       int 21h
  58.       ; wait for keypressed
  59.       mov ah, 0
  60.       int 16h
  61.       ; set 25-lines mode
  62.       mov ax, 3h
  63.       int 10h
  64.       ; return to dos
  65.       mov ah, 4ch
  66.       int 21h
  67. Body  ENDP
  68.  
  69. FName db 'coolview.bin',0
  70. FErr  db 'Error loading file.',13,10,'$'
  71.  
  72. Code  ENDS
  73.       END Body